<?php

namespace App\Http\Controllers\home;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;

class Lists extends Common
{
    //列表页
    public function index(Request $request)
    {
        $aid = (int)$request->id;
        $data['admin']   = DB::table('admin')->cates('id');
        $data['user']   = DB::table('member')->cates('id');
        $data['item'] = DB::table('article_cate')->where('id',$aid)->item();
        $data['lists'] = DB::table('article')->where('cid',$aid)->lists();
        $data['member'] = Auth::guard('member')->user();
        return view('home.lists',$data);
    }
}
